more rift.c
// 02/12/00 Hawk - taken out of Hakama and made into stand alone command for
// ninjas
#include
inherit CMD_BASE;
#define GP_COST 400
object source, dest;
int help( object me )
{
tell_object( me, "\nSyntax: rift\n\n"
"This ability allows you to create a temporary 'doorway' to another"
" budoka. To use this ability you will need 20000 experience and "+
GP_COST+" guild points.\n" );
return 1;
}
int query_valid_use( object ob )
{
if( !ob->query_property( "com_list" ) ||
ob->query_property( "com_list")["sixth"]
!= "rift" ) return 0;
return 1;
}
int add_rift( string str, object ob ){
object target, me;
me = ob;
str = (string)ob->expand_nickname(str);
if(!(target=find_player(str))) {
tell_object(me,"Spirit tells you: Hmmm. I can't find a player"
" named "+capitalize(str)+".\n");
return 0;
}
if( target->query_guild() != "budoka" )
{
tell_object(me,"The spirit tells you: You can only rift to other"
" Budokas.\n");
return 0;
}
if (target->query_creator()) {
tell_object(me,"Spirit says: Teleport to an immortal?"
" I think not.\n");
return 0;
/* you don't want them popping in on you ... do you? */
}
source = environment(ob);
dest = environment(target);
if (source == dest){
tell_object(me,"Spirit telepaths: The rift cannot be aligned"
" properly.\n");
return 0;
}
//Begin Raches mods
if(!dest->query_property("budokas")){
if(!dest->query_teleport_in()){
tell_object(me,"Spirit telepaths: The rift cannot be opened"
" across such a great distance.\n");
return 0;
}
if(!source->query_teleport_out()){
tell_object(me,"Spirit telepaths: Something is interfering"
" with the rift.\n");
return 0;
}
}
//End Rache's mods
tell_object(target, ob->query_cap_name()+
" opens a door within the smoke,"
" creating a temporary rift between you and "
+ob->query_pronoun()+".\n");
/* add the exit 'rift' to the target's room */
//following line added by Hellbent, per Rahvin's request
//12-09-96
if(file_name(source)[2] == 'd')
dest->add_exit("smoke", file_name(source), "corridor");
tell_room(dest, "There is a lot tell_room(dest, "There is a lot of smoke in the room. You can barely"
" make out a passage in the smoke.\n");
source->add_exit("smoke", file_name(dest), "corridor");
tell_room(source, "There is a lot of smoke in the room. Through the"
" smoke, you can just barely make out a passage.\n");
call_out( "remove_rift", 30 );
tell_object( ob, "\nSpirit telepaths: The smoke is now"
" here as an obvious exit.\n");
return 1;
}
/* remove the rift */
int remove_rift(){
if(dest) {
dest->remove_exit("smoke");
tell_room(dest, "The smoke dissipates, and the room is clear"
" once again.\n");
}
if (source) {
source->remove_exit("smoke");
tell_room(source, "The smoke clears, and the room is clear"
" once again.\n");
}
tell_object( environment(),
"The hakama disappears in a cloud of smoke.\n" );
this_object()->dest_me();
return 1;
}
protected int cmd( class command cmd )
{
if( !query_valid_use( cmd->user ) ) return 0;
if( cmd->arg == "help" ) return help( cmd->user );
if( cmd->user->query_gp() < GP_COST )
return notify_fail( "You are too drained to open a rift.\n" );
if(cmd->user->query_xp() < 2000)
return notify_fail( "Sorry, it requires at least 2000 experience"
" points to use.\n");
if( !cmd->user->query_property( "com_list" ) ||
cmd->user->query_property( "com_list")["sixth"] != "rift" ) return 0;
cmd->user->adjust_xp(-2000);
cmd->user->adjust_gp( -GP_COST );
tell_room(environment(cmd->user),
cmd->user->query_cap_name() + " folds his arms and says a "
"strange verse. Suddenly something strange begins to happen.\n"
"\n",
({cmd->user}));
tell_object( cmd->user,
"As you begin to chant, you feel a mind link connect"
" with you.\nSpirit telepaths: Type who you want"
" to go to: " );
input_to( "add_rift", cmd->user );
return 1;
}